From 31e6c96848815d172d470c2e1a85c28fe0a96d7d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Mar 2018 01:56:46 +0300 Subject: [PATCH] Restore --features args for cargo rustdoc It was accidentally omited when migrating to clap --- src/bin/commands/rustdoc.rs | 1 + tests/testsuite/rustdoc.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/bin/commands/rustdoc.rs b/src/bin/commands/rustdoc.rs index 2350aed19..abd2c7405 100644 --- a/src/bin/commands/rustdoc.rs +++ b/src/bin/commands/rustdoc.rs @@ -26,6 +26,7 @@ pub fn cli() -> App { "Build all targets (default)", ) .arg_release("Build artifacts in release mode, with optimizations") + .arg_features() .arg_manifest_path() .arg_message_format() .after_help( diff --git a/tests/testsuite/rustdoc.rs b/tests/testsuite/rustdoc.rs index b6ba19bd7..06e20c20e 100644 --- a/tests/testsuite/rustdoc.rs +++ b/tests/testsuite/rustdoc.rs @@ -225,3 +225,29 @@ fn rustdoc_same_name_documents_lib() { )), ); } + +#[test] +fn features() { + let p = project("foo") + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [features] + quux = [] + "#, + ) + .file("src/lib.rs", "") + .build(); + + assert_that( + p.cargo("rustdoc --verbose --features quux"), + execs() + .with_status(0) + .with_stderr_contains("[..]feature=[..]quux[..]"), + ); +} -- 2.30.2